#include <stdio.h>
#include <math.h>

int main()
{
	int m = 0;
	int n = 1;
	float sum = 0.0f;
	float i = 0.0f;
	float PI = 0.0f;
	
	do
	{
		i = pow(-1,m) * pow(n,-1);
		n += 2;
		m++;
		sum += i;
	} while(fabs(i) >= 1.0e-6);
	PI = sum * 4;
	printf("PI = %f\n",PI);
	return 0;
}
